package com.ease.util {

   import mx.collections.XMLListCollection;

   /**
    * @private
    *
    * TODO Move this out of flex-util.
    */
   [ExcludeClass]
   public class MxmlManifest {
      private static var manifest:XML =
         <componentPackage>
            <component id="UIComponent" class="mx.core.UIComponent">
               <include name="id" kind="property"/>
               <include name="x" kind="property"/>
               <include name="y" kind="property"/>
               <include name="width" kind="property"/>
               <include name="height" kind="property"/>
               <include name="percentWidth" kind="property"/>
               <include name="percentHeight" kind="property"/>
               <include name="styleName" kind="property" />
            </component>
            <component id="Container" class="mx.core.Container">
               <include name="horizontalScrollPolicy" kind="property"/>
               <include name="verticalScrollPolicy" kind="property"/>
            </component>
            <component id="Panel" class="mx.containers.Panel">
               <include name="title" kind="property"/>
               <include name="layout" kind="property"/>
            </component>
            <component id="DragPanel" class="com.ease.portalfw.component.DragPanel">
               <include name="showControls" kind="property"/>
               <include name="showTitleBar" kind="property"/>
               <include name="resizable" kind="property"/>
               <include name="draggable" kind="property"/>
            </component>
            <component id="PortletChrome" class="com.ease.portalfw.PortletChrome">
               <include name="fadeControls" kind="property"/>
               <include name="customLayout" kind="property"/>
            </component>
            <component id="Portlet" class="com.ease.portalfw.Portlet">
               <include name="id" kind="property"/>
               <include name="chrome" kind="property"/>
               <include name="childPortlets" kind="property"/>
               <include name="content" kind="property"/>
            </component>
            <component id="ArrayCollection" class="mx.collections.ArrayCollection">
               <include name="source" kind="property"/>
            </component>
            <component id="Date" class="Date">
               <include name="time" kind="property"/>
            </component>
         </componentPackage>;

      internal static function getComponentClass(id:String):String {
         return manifest.component.(@id == id || @["class"] == id).@["class"];
      }

      internal static function getInclusions(id:String):XMLListCollection {
         var components:XMLList =
            manifest.component.(@id == id || @["class"] == id);
         return new XMLListCollection(components["include"].@name);
      }
   }

}
